Link against the packaged version of libpcre2
authorMichael R. Crusoe <crusoe@debian.org>
Wed, 12 Feb 2025 00:58:32 +0000 (00:58 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Wed, 12 Feb 2025 00:58:32 +0000 (00:58 +0000)
Instead of the code copy.

Gbp-Pq: Name packaged_libpcre2

CMakeLists.txt
src/pcre2/CMakeLists.txt

index 1b59b31073eb993a3bf76768e794a8bad0ff95a3..41346026c6fbe1108661d8bc9f3ea4aadde23447 100644 (file)
@@ -5,7 +5,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
 
 set(CMAKE_C_STANDARD 99)
 
-set(PCRE2_INCLUDE_DIR ${CMAKE_BINARY_DIR}/src/libpcre2)
+set(PCRE2_INCLUDE_DIR /usr/include)
 set(CYTHON_EXTRA_COMPILE_ARGS -DPCRE2_CODE_UNIT_WIDTH=8 -fPIC)
 
 # Set PCRE2 options.
@@ -15,11 +15,6 @@ set(PCRE2_NEVER_BACKSLASH_C ON CACHE BOOL "" FORCE)
 # Always make a release build.
 set(CMAKE_BUILD_TYPE Release)
 
-# Build PCRE2 library as both shared and static.
-set(BUILD_STATIC_LIBS ON)
-set(BUILD_SHARED_LIBS ON)
-add_subdirectory(src/libpcre2)
-
 # Build Cython code as shared.
 set(BUILD_STATIC_LIBS OFF)
 set(BUILD_SHARED_LIBS ON)
index 38c117e928c00f96cd56b9e486511963fa4fa9a4..3188e073a152fefc3a629ab47212fc9ae6510e0a 100644 (file)
@@ -12,7 +12,7 @@ macro(add_pyx_file filename)
     add_library(${filename} MODULE ${filename})
     python_extension_module(${filename})
 
-    target_link_libraries(${filename} pcre2-8-static)
+    target_link_libraries(${filename} pcre2-8)
     target_include_directories(${filename} PRIVATE ${PCRE2_INCLUDE_DIR})
     target_compile_options(${filename} PRIVATE ${CYTHON_EXTRA_COMPILE_ARGS})
     
@@ -50,4 +50,4 @@ install(
         utils.pyx
     DESTINATION
         src/pcre2
-)
\ No newline at end of file
+)